package no.group.gowther.rest.vo;

import no.group.gowther.enums.OnePieceType;
import no.group.gowther.service.dto.ImageCode;
import no.group.gowther.service.dto.OnePieceDTO;
import no.group.gowther.service.dto.TagDTO;

import java.util.List;
import java.util.stream.Collectors;

public class OnePieceDetailVO {
    private Long id;
    private String name;
    private OnePieceType type;
    private List<TagDTO> tag;
    private List<String> imageCodes;

    public OnePieceDetailVO(OnePieceDTO dto) {
        id = dto.getId();
        name = dto.getName();
        type = dto.getType();
        tag = dto.getTag();
        imageCodes = dto.getImageCodes().stream().map(ImageCode::getUrlEncodeImageCode).collect(Collectors.toList());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public OnePieceType getType() {
        return type;
    }

    public void setType(OnePieceType type) {
        this.type = type;
    }

    public List<TagDTO> getTag() {
        return tag;
    }

    public void setTag(List<TagDTO> tag) {
        this.tag = tag;
    }

    public List<String> getImageCodes() {
        return imageCodes;
    }

    public void setImageCodes(List<String> imageCodes) {
        this.imageCodes = imageCodes;
    }
}
